package com.hoshino.momochi.service.Impl;

import com.hoshino.momochi.mapper.CollectionBlogMapper;
import com.hoshino.momochi.model.domain.Blog;
import com.hoshino.momochi.model.domain.BlogStar;
import com.hoshino.momochi.model.domain.CollectionBlog;
import com.hoshino.momochi.service.CollectionBlogService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

import java.util.List;

@Service
public class CollectionBlogServiceImpl implements CollectionBlogService {

    @Autowired
    private CollectionBlogMapper collectionBlogMapper;

    @Override
    public CollectionBlog findTreeNode(CollectionBlog collectionBlog) {
        return collectionBlogMapper.findTreeNode(collectionBlog);
    }

    @Override
    public List<Blog> findCollectionBlogs(Long id) {
        return collectionBlogMapper.findCollectionBlogs(id);
    }

    @Override
    public List<CollectionBlog> findAllByUserId(CollectionBlog collectionBlog) {
        return collectionBlogMapper.findAllByUserId(collectionBlog);
    }

    @Override
    public void createCollectionBlog(CollectionBlog collectionBlog) {
        collectionBlogMapper.createCollectionBlog(collectionBlog);
    }

    @Override
    public void delCollectionBlog(CollectionBlog collectionBlog) {
        collectionBlogMapper.delCollectionBlog(collectionBlog);
    }

    @Override
    public void addBlogInCollection(BlogStar blogStar) {
        collectionBlogMapper.addBlogInCollection(blogStar);
    }

    @Override
    public void delBlogInCollection(BlogStar blogStar) {
        collectionBlogMapper.delBlogInCollection(blogStar);
    }

    @Override
    public Long getCidByUserId(Long uid, Long cid) {
        return collectionBlogMapper.getCidByUserId(uid, cid);
    }

    @Override
    public BlogStar findByTwoId(Long cid, Long bid) {
        return collectionBlogMapper.findByTwoId(cid, bid);
    }

    @Override
    public Long findUserIsStar(Long uid, Long bid) {
        return collectionBlogMapper.findUserIsStar(uid, bid);
    }

    @Override
    public void delUserBlogStar(Long cid, Long bid) {
        collectionBlogMapper.delUserBlogStar(cid, bid);
    }

    @Override
    public void delIsDeleteAsTrue() {
        collectionBlogMapper.delIsDeleteAsTrue();
    }

    @Override
    public void delCollectionAllStar(Long cid) {

    }
}
